#include <iostream>
#include <vector>

const int MAP_WIDTH = 20;
const int MAP_HEIGHT = 20;
const int TANK_LIFE = 3;

class Tank {
public:
    int x;
    int y;
    int life;

    Tank(int x, int y) : x(x), y(y), life(TANK_LIFE) {}

    void moveLeft() {
        x--;
    }

    void moveRight() {
        x++;
    }

    void moveUp() {
        y--;
    }

    void moveDown() {
        y++;
    }

    void takeDamage() {
        life--;
    }

    bool isDead() {
        return life <= 0;
    }
};

class Game {
public:
    std::vector<Tank> tanks;

    void addTank(int x, int y) {
        tanks.emplace_back(x, y);
    }

    void fire(int tankIndex, int targetIndex) {
        auto& tank = tanks[tankIndex];
        auto& target = tanks[targetIndex];
        target.takeDamage();
        if (target.isDead()) {
            std::cout << "Tank " << targetIndex << " is destroyed." << std::endl;
        }
    }

    bool isFinished() {
        return tanks.size() == 1;
    }
};

int main() {
    Game game;
    game.addTank(0, 0);
    game.addTank(MAP_WIDTH - 1, MAP_HEIGHT - 1);

    while (!game.isFinished()) {
        int tankIndex, targetIndex;
        std::cin >> tankIndex >> targetIndex;
        game.fire(tankIndex, targetIndex);
    }

    return 0;
}
